# -*- coding: utf-8 -*-
class Car():
    """create a car class"""

    def __init__ (self, make, model, year):
        """ init function params make model year"""
        self.make = make
        self.model = model
        self.year = year
        self.odometer_reading = 1

    def get_descriptive_name (self):
        long_name = str(self.year) + " " + self.make + " " + self.model
        return long_name.title()

    def red_odometer(self):
        print("\nThis car has " + str(self.odometer_reading) + " miles on it.")
    
    def update_odometer(self, odometer):
        old_odometer = self.odometer_reading
        if old_odometer > odometer:
            self.odometer_reading = odometer
            print('update odometer_reading options ' + str(old_odometer) + ' to change ' 
            + str(self.odometer_reading))
        else:
            print("Your can't roll back an odometer")

    def increment_odometer(self, miles):
        """ 通过自增的方式来修改属性的值 """
        self.odometer_reading += miles

    def fill_gas_tank(self):
        print('This car neet a gas tank!')




